function [ legal_moves ] = getLegalMoves( piece )

switch piece
    case 1
        legal_moves = [1:5;ones(1,5)];
    case 2
        legal_moves = [2:6,2:5,1:5,2:5;ones(1,5),2*ones(1,4),3*ones(1,5), ...
            4*ones(1,4)];
    case 3
        legal_moves = [1:5,2:5,2:6,2:5;ones(1,5),2*ones(1,4),3*ones(1,5), ...
            4*ones(1,4)];
    case {4,5}
        legal_moves = [2:6,2:5;ones(1,5),2*ones(1,4)];
    case 6
        legal_moves = [2:4,1:6;ones(1,3),2*ones(1,6)];
    case 7
        legal_moves = [2:5,2:6,2:5,1:5;ones(1,4),2*ones(1,5),3*ones(1,4), ...
            4*ones(1,5)];    
end
end

